{include file="$g_template/_fronthead.tpl"}
<div id="wrap_3">
		<div id="header">
			<div class="logo"><img src="{$g_image}/logo.png"></div>
			<div class="welcome"><img src="{$g_image}/welcome.png"></div>
		</div>
        
        {include file="$g_template/_mainmenu.tpl"}
        
	<div id="web_content3">
		<div class="title_content_detail">Payment<br><span style="font-size: 16px;">{$today}</span></div>
		<div class="line"></div>
		<div id="area_title_description">
			<div class="text_title_description">
				<p>
					<span class="text_black_title">Payment ID: </span><span class="text_red_title"> -<!--{$paymentId}--></span>	
				</p>
			</div>
			<div class="text_title_images"><span style="float:right;"><img src="{$g_image}/{$img}"></span></div>
		</div>
			
		<div class="showdetail"><br>
			<table width="700" align="center" border="0" cellpadding="3" cellspacing="0" style="font-size:16px; font-family: Times New Roman;">
				<tr>
					<td class="UnderLine"  colspan="2" align="center"><span class="text_black_bold">ข้อมูล Pre-auth</span></td>
				</tr>
				<tr>
					<td  colspan="2" align="left">&nbsp;</td>
				</tr>
				<tr>
					<td align="left"><span style="margin-left:20px;">Pre-auth เลขที่ : {$preauthData.preauth_id}</span></td>
					<td align="left"><span style="margin-left:20px;">วันที่ทำ Pre-auth : {$preauthData.preauth_datetime}</span></td>
				</tr>
				<tr>
					<td align="left"><span style="margin-left:20px;">ชื่อผู้ทำ Pre-auth : {$_profile->user_prename}{$_profile->user_name}&nbsp;{$_profile->user_surname}</span></td>
					<td align="left"><span style="margin-left:20px;">รหัสผู้ใช้ : {$_profile->userid}</span></td>
				</tr>
				<tr>
					<td align="left"><span style="margin-left:20px;">หน่วยงาน : {$_profile->group_name}</span></td>
					<td align="left"><span style="margin-left:20px;">ตำแหน่ง : {$_profile->usertype_description}</span></td>
				</tr>
				<tr>
					<td align="left">&nbsp;</td>
				</tr>
			</table>
			
			<table width="700" align="center" border="0" cellpadding="3" cellspacing="0" style="font-size:16px; font-family: Times New Roman;">
				<tr>
					<td class="UnderLine"  colspan="4" align="center"><span class="text_black_bold">ข้อมูลกรมธรรม์</span></td>
				</tr>
				<tr>
					<td colspan="4" align="center">&nbsp;</td>
				</tr>
				<tr>
					<td align="right">ชื่อผู้เอาประกัน :</td>
					<td>{$policyData.name}  {$policyData.surname}</td>
					<td align="right">บัตรประชาชน: </td>
					<td>{$policyData.natid}</td>
				</tr>
				<tr>
					<td align="right">เลขที่่กรมธรรม์ :</td>
					<td>{$policyData.policy_no}</td>
					<td align="right">เลขที่บัตรประกัน :</td>
					<td>{$policyData.cardno}</td>
				</tr>
				<tr>
					<td align="right">วันเริ่มคุ้มครอง :</td>
					<td>{$policyData.effective}</td>
					<td align="right">วันสิ้นสุดความคุ้มครอง :</td>
					<td>{$policyData.expiry}</td>
				</tr>
				<tr>
					<td align="right">แผนความคุ้มครอง :</td>
					<td>{$policyData.plan}</td>
					<td align="right">&nbsp;</td>
					<td></td>
				</tr>
				<tr>
					<td align="right">OPD :</td>
					<td>{$PlanData.opd}</td>
					<td align="right">ER :</td>
					<td>{$PlanData.er}</td>
				</tr>
				<tr>
					<td align="right">OPD คงเหลือ :</td>
					<td>{$PlanData.opdremain}</td>
					<td align="right">R&B :</td>
					<td>{$PlanData.rb}</td>
				</tr>
				<tr>
					<td align="right">Deductible :</td>
					<td>{$policyData.deductible}-{$paInfo.deducper}</td>
					<td align="right">Co-Payment :</td>
					<td>{$policyData.copayment}</td>
				</tr>
				
				<tr>
					<td valign="top" align="right" >รายการ Deductible คงเหลือ :</td>	
					<td colspan="3" align="left">
						<div id="tbl-DeducList_container">
						<table width="70%" align="left" border="0" cellpadding="0" cellspacing="0" >
									
							{foreach from=$deducList item=item}
							<tr>
								{if $item.deduc == 0 }
									<td align="left" >ไม่มี Deductible คงเหลือ</td>
								{else}
									<td align="left" >{$item.dgroup} => ( คงเหลือ {$item.deduc} )</td>
								{/if}
								
							</tr>
							{/foreach}
						</table>
						</div>
					</td>

				</tr>
				<tr>
					<td colspan="4">&nbsp;</td>
				</tr>
			</table>
			
			<table width="700" align="center" border="0" cellpadding="3" cellspacing="0" style="font-size:16px; font-family: Times New Roman;">
				<tr>
					<td class="UnderLine"  colspan="5" align="center"><span class="text_black_bold">ระบุยอดค่าใช้จ่าย</span></td>
				</tr>
				<tr>
					<td  width="25%" align="center">&nbsp;</td>
					<td  width="25%" align="center">&nbsp;</td>
					<td  width="25%" align="center">&nbsp;</td>
					<td  width="25%" align="center">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="4">
						<div class="payment_exp_left">
							<table border = "0">
							<ul>
								<tr>
									<td>
										<li><label >Admission Date : </label>
									</td>
									<td>
										<input type="text" name="txt_admis_date" id="txt_admis_date" style="width: 70px; text-align: center;" readonly="true" value="{$default_date}">
										<select id="adm_hour" name="adm_hour">
											{foreach from=$arr_hour item=item}
												<option value="{$item}" {if $default_hour eq $item}selected{/if}>{$item}</option>
											{/foreach}
										</select>
										<select id="adm_min" name="adm_min">
											{foreach from=$arr_min item=item}
												<option value="{$item}" {if $default_min eq $item}selected{/if}>{$item}</option>
											{/foreach}
										</select></li>
									</td>
								</tr>
								<tr>
									<li>
										<td align="right" valign="top"><label>Cover List :</label></td>
										<td>
										<div id="tbl-AccList_container">
											<table width="300" align="left" border="0" cellpadding="0" cellspacing="0" style="font-size:16px; font-family: Times New Roman; ">
												{foreach from=$claimGetCover item=item}
													<tr><td style="color:#b4b5b7;">
															<input type="radio" id="cover_type" name="cover_type" disabled {if $item.covertype eq "ME"}checked="checked"{/if} value="{$item.covertype}" />{$item.coverdesc} 
													</td></tr>
												{/foreach}
											</table
										</div>
										</td>		
									</li>
								</tr>
								<tr>
									<td><li><label>Accident Date : </label></td>
									<td>
										<input type="text" name="txt_acc_date" id="txt_acc_date" style="width: 70px; text-align: center;" readonly="true" value="{$default_date}">
										<select id="acc_hour" name="acc_hour">
											{foreach from=$arr_hour item=item}
												<option value="{$item}" {if $default_hour eq $item}selected{/if}>{$item}</option>
											{/foreach}
										</select>
										<select id="acc_min" name="acc_min">
											{foreach from=$arr_min item=item}
												<option value="{$item}" {if $default_min eq $item}selected{/if}>{$item}</option>
											{/foreach}
										</select></li>
									</td>
								</tr>
								<tr>
									<td valign="top"><li><label>Accident List : </label> </td>
									<td>
									<div id="tbl-AccList_container" style="border:2px solid; height:100px; ">
										<table align="left" border="0" cellpadding="0" cellspacing="0" >
											<tr><td>
												<input type="radio" id="accList" name="accList" checked="checked" value="0" onclick="_renderAcclistToAccdate();" /><label for="accList">N/A</label>
											</td></tr>
											{foreach from=$accList item=item}
												{if $item.acc_date == 0 }												
													<tr><td align="left" >ไม่มีอุบัติเหตุก่อนหน้านี้</td></tr>
												{else}
													<tr><td>
															<input type="radio" id="accList" name="accList" value="{$item.acc_date}&{$item.cause_type}" onclick="_renderAcclistToAccdate();"/><label for="accList">{$item.acc_date} ({$item.cause_type})(คงเหลือ:{$item.cover_remain})</label>
													</td></tr>
												{/if}
											{/foreach}
										</table
									</div>
										</select>
									</li>
									</td>
								</tr>
								<tr>
									<td valign="top"><li><label>Deductible List : </label> </td>
									<td>
									<div id="tbl-AccList_container" style="border:2px solid; height:100px; ">
										<table align="left" border="0" cellpadding="0" cellspacing="0" >
											<tr><td>
												<input type="radio" id="DeducList" name="DeducList" checked="checked" value="0"/><label for="DeducList">N/A</label>
											</td></tr>
											{foreach from=$deducList item=item}
												{if $item.deduc == 0 }												
													<tr><td align="left" >ไม่มี Deductible คงเหลือ</td></tr>
												{else}
													<tr><td>
															<input type="radio" id="DeducList" name="DeducList" value="{$item.deduc}"/><label for="DeducList">{$item.dgroup} => ( คงเหลือ {$item.deduc} )</label>
													</td></tr>
												{/if}
												
											{/foreach}
										</table
									</div>
									</li>
									</td>
								</tr>
							</ul>
							</table>
						</div>
						<input type="hidden" name="hid_menuseq" id="hid_menuseq" value="{$menuseq}">
						<div class="payment_exp_right">
							<ul>
								<li><label>Charge : </label><input type="text" name="txt_charge" id="txt_charge" value="0" style="width: 100px; text-align: right;">&nbsp;บาท</li>
								<li>
									<label>Discount : </label><input type="text" name="txt_discount" id="txt_discount" value="0" style="width: 100px; text-align: right;">&nbsp;บาท&nbsp;<input type="button" class="btncal" name="calculate" id="calculate" value="Calculate" onclick="_renderCalculate();">
								</li>
								<li><label>Deductible Remain : </label><input type="text" name="txt_deductible" id="txt_deductible" style="width: 100px; text-align: right;">&nbsp;บาท</li>
								<li><label>Co-Payment Remain : </label><input type="text" name="txt_co_payment" id="txt_co_payment" style="width: 100px; text-align: right;">&nbsp;บาท</li>
								<li><br><label><font color="red">Pre Approved : </font></label><input type="text" name="txt_pre_approved" id="txt_pre_approved" style="width: 100px; text-align: right;">&nbsp;บาท</li>
								<li><label><font color="red">Non Covered : </font></label><input type="text" name="txt_non_covered" id="txt_non_covered" style="width: 100px; text-align: right;">&nbsp;บาท</li>
							</ul>
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="4">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="4" align="left">สาเหตุการรักษา :<br>
					<textarea name="tar_remark" id="tar_remark" rows="12" cols="85"></textarea>
					</td>
				</tr>
				<tr>
					<td colspan="4">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="4" align="center">
						<input type="hidden" name="hid_payment_id" id="hid_payment_id" value="{$paymentId}">
						<input type="hidden" name="hid_user_id" id="hid_user_id" value="{$_profile->userid}">
						<input type="hidden" name="hid_preauth_id" id="hid_preauth_id" value="{$preauthData.preauth_id}">
						<input type="hidden" name="hid_policy_no" id="hid_policy_no" value="{$policyData.policy_no}">
						<input type="hidden" name="hid_payment_datetime" id="hid_payment_datetime" value="{$payment_datetime}">
						<input type="hidden" name="hid_payment_status" id="hid_payment_status" value="1">
						<input type="hidden" name="hid_menu_seq" id="hid_menu_seq" value="HE">
						<input type="hidden" name="hid_customer_type" id="hid_customer_type" value="{$policyData.customer_type}">
						<input type="hidden" name="hid_policy_id" id="hid_policy_id" value="{$policyData.policyid}">
						<input type="hidden" name="hid_customer_type_desc" id="hid_customer_type_desc" value="{$policyData.customer_type_desc}">
						<input type="hidden" name="hid_er_followin" id="hid_er_followin" value="{$PlanData.er_followin}">
						<input type="hidden" name="hid_opd_waiting" id="hid_opd_waiting" value="{$PlanData.opd_waiting}">
						<input type="hidden" name="hid_LastAdmisOPD" id="hid_LastAdmisOPD" value="{$LastAdmisOPD}">
						
						<input type="submit" name="btn_submit" value="ยืนยัน" style="width: 100px;" onclick="_renderPaymentConfirm();">
						<a id="link_payment_list"></a>
						<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="btn_print" value="Print" style="width: 100px;"> -->
					</td>
				</tr>
				<tr>
					<td colspan="4">&nbsp;</td>
				</tr>
			</table>
			
		</div>
		
	</div>
{include file="$g_template/_frontfoot.tpl"}